export const imgList = ["png", "jpg", "jpeg"];
export const docList = ["doc", "docx"];
export const excelList = ["xlsx", "xls"];
export const pdfList = ["pdf"];
export const apkList = ["apk"];
export const zipist = ["zip"];
export const pptList = ["ppt"];
export const txtList = ["txt"];

export const getFileTypeByName = (name) => {
  if (!name) return "excel";
  const filePop = name.split(".").pop();
  if (imgList.includes(filePop)) return "img";
  else if (docList.includes(filePop)) return "doc";
  else if (pdfList.includes(filePop)) return "pdf";
  else if (apkList.includes(filePop)) return "apk";
  else if (zipist.includes(filePop)) return "zip";
  else if (pptList.includes(filePop)) return "ppt";
  else if (txtList.includes(filePop)) return "txt";
  else return "excel";
};
